Optimal. Leaf size=60 \[ -\frac{x (2 a+3 b)}{2 b^2}-\frac{(a+b)^{3/2} \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{\sqrt{a} b^2}+\frac{\sin (x) \cos (x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.105133, antiderivative size = 60, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3191, 414, 522, 203, 205} \[ -\frac{x (2 a+3 b)}{2 b^2}-\frac{(a+b)^{3/2} \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{\sqrt{a} b^2}+\frac{\sin (x) \cos (x)}{2 b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3191
Rule 414
Rule 522
Rule 203
Rule 205
Rubi steps
\begin{align*} \int \frac{\sin ^4(x)}{a+b \cos ^2(x)} \, dx &=-\operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right )^2 \left (a+(a+b) x^2\right )} \, dx,x,\cot (x)\right )\\ &=\frac{\cos (x) \sin (x)}{2 b}-\frac{\operatorname{Subst}\left (\int \frac{a+2 b+(-a-b) x^2}{\left (1+x^2\right ) \left (a+(a+b) x^2\right )} \, dx,x,\cot (x)\right )}{2 b}\\ &=\frac{\cos (x) \sin (x)}{2 b}-\frac{(a+b)^2 \operatorname{Subst}\left (\int \frac{1}{a+(a+b) x^2} \, dx,x,\cot (x)\right )}{b^2}+\frac{(2 a+3 b) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\cot (x)\right )}{2 b^2}\\ &=-\frac{(2 a+3 b) x}{2 b^2}-\frac{(a+b)^{3/2} \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{\sqrt{a} b^2}+\frac{\cos (x) \sin (x)}{2 b}\\ \end{align*}
Mathematica [A] time = 0.0981396, size = 52, normalized size = 0.87 \[ \frac{\frac{4 (a+b)^{3/2} \tan ^{-1}\left (\frac{\sqrt{a} \tan (x)}{\sqrt{a+b}}\right )}{\sqrt{a}}-4 a x-6 b x+b \sin (2 x)}{4 b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.025, size = 105, normalized size = 1.8 \begin{align*}{\frac{{a}^{2}}{{b}^{2}}\arctan \left ({a\tan \left ( x \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}}+2\,{\frac{a}{b\sqrt{ \left ( a+b \right ) a}}\arctan \left ({\frac{a\tan \left ( x \right ) }{\sqrt{ \left ( a+b \right ) a}}} \right ) }+{\arctan \left ({a\tan \left ( x \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}}+{\frac{\tan \left ( x \right ) }{2\,b \left ( \left ( \tan \left ( x \right ) \right ) ^{2}+1 \right ) }}-{\frac{3\,\arctan \left ( \tan \left ( x \right ) \right ) }{2\,b}}-{\frac{\arctan \left ( \tan \left ( x \right ) \right ) a}{{b}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.90039, size = 541, normalized size = 9.02 \begin{align*} \left [\frac{2 \, b \cos \left (x\right ) \sin \left (x\right ) +{\left (a + b\right )} \sqrt{-\frac{a + b}{a}} \log \left (\frac{{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \,{\left (4 \, a^{2} + 3 \, a b\right )} \cos \left (x\right )^{2} - 4 \,{\left ({\left (2 \, a^{2} + a b\right )} \cos \left (x\right )^{3} - a^{2} \cos \left (x\right )\right )} \sqrt{-\frac{a + b}{a}} \sin \left (x\right ) + a^{2}}{b^{2} \cos \left (x\right )^{4} + 2 \, a b \cos \left (x\right )^{2} + a^{2}}\right ) - 2 \,{\left (2 \, a + 3 \, b\right )} x}{4 \, b^{2}}, \frac{b \cos \left (x\right ) \sin \left (x\right ) -{\left (a + b\right )} \sqrt{\frac{a + b}{a}} \arctan \left (\frac{{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a\right )} \sqrt{\frac{a + b}{a}}}{2 \,{\left (a + b\right )} \cos \left (x\right ) \sin \left (x\right )}\right ) -{\left (2 \, a + 3 \, b\right )} x}{2 \, b^{2}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.15312, size = 108, normalized size = 1.8 \begin{align*} -\frac{{\left (2 \, a + 3 \, b\right )} x}{2 \, b^{2}} + \frac{{\left (\pi \left \lfloor \frac{x}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (a\right ) + \arctan \left (\frac{a \tan \left (x\right )}{\sqrt{a^{2} + a b}}\right )\right )}{\left (a^{2} + 2 \, a b + b^{2}\right )}}{\sqrt{a^{2} + a b} b^{2}} + \frac{\tan \left (x\right )}{2 \,{\left (\tan \left (x\right )^{2} + 1\right )} b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]